package day4;

import java.util.ArrayList;
import java.util.List;

/**
 * @author oldliu
 * @since 1.0
 */
public class TestBAnk {
    public static void main(String[] args) {
        List list=new ArrayList();
        list.add(new BankAcc("hf--1","老吴","123","shanghai",1000000.0F));
        list.add(new BankAcc("hf--2","小刘","1243","shanghai",100030.0F));
        list.add(new BankAcc("hf--3","小李","1523","nanjing",60000.0F));
        list.add(new BankAcc("hf--4","老张","623","shanghai",1000.0F));
        for(int i=0;i<list.size();i++){
            BankAcc b=(BankAcc)list.get(i);
            System.out.println("账号："+b.getNo()+",余额是"+b.getMoney()+"元");
        }
        BankAcc ba=new BankAcc("hf--3","小马","282938282", "安庆",7676666.0F);
        boolean in=list.contains(ba);
        System.out.println(in);
        int pos=list.indexOf(ba);
        System.out.printf("位置在：%d",pos);
    }
}
